//
//  ViewController.m
//  Methods and Functions
//
//  Created by iD Student on 6/25/13.
//  Copyright (c) 2013 iD Student. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (void) addToScore{
    int amountToAdd = 10;
    score += amountToAdd;
}

- (int) getScore
{
    return score;
}
- (void) gameOver
{
    int playerScore = [self getScore];
    if(playerScore > 10)
    {
        gameLabel.text = @"Good Score!";
    }
}
- (void) gameOver:(int)winner
{
    if(winner == 1)
    {
        [self updateLabel:label withText:[NSString stringWithString@"Player 1 wins"]];
    }
    else if(winner == 2)
    {
        [self updateLabel:label withText:[NSString stringWithString@"Player 1 wins"]];
    }
}
- (void) updateLabel:(UILabel *)label withText:(NSString *)text
{
    label.text = text;
}

@end
